package com.situ.firmadmin.controller;


import com.situ.firmadmin.pojo.Admin;
import com.situ.firmadmin.pojo.User;
import com.situ.firmadmin.service.IAdminService;
import com.situ.firmadmin.util.Result;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    private IAdminService adminService;

    @GetMapping("/selectAll/{dId}")
    public Result selectAll(@PathVariable Integer dId){
        List<Admin> list = adminService.selectAll(dId);
        return Result.ok(list);
    }
    
    @GetMapping("/selectSuperAdmin")
    public Result selectAll(){
        List<Admin> list = adminService.selectSuperAdmin();
        return Result.ok(list);
    }
    
    @GetMapping("/selectAllAdmin")
    public Result selectAllAdmin(){
        List<Admin> list = adminService.selectAllAdmin();
        return Result.ok(list);
    }

}
